package sketch.specs;

import java.util.List;

import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.MethodDeclaration;

import sketch.ast.ASTUtils;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class ParenthesesRemoverTest extends TestCase {

	public static Test suite() {
		return new TestSuite(ParenthesesRemoverTest.class);
	}
	
	public void testBruteForcePathRemove() {
		System.out.println("Testing removing redundant { and } !");
		String filePath = "./testfiles/sketch/specs/ParenRemove.java";
		CompilationUnit unit = ASTUtils.astRoot(filePath);
		List<MethodDeclaration> methods = ASTUtils.getAllMethods(unit);
		for(MethodDeclaration method : methods) {
			RedundantParenthesesRemover<MethodDeclaration> remover = new RedundantParenthesesRemover<MethodDeclaration>(method);
//			MethodDeclaration afterRemoving = remover.getResult();
			System.out.println(remover.removeParenthesisInBlock(method.getBody()));
			System.out.println("\n\n\n");
		}
	}
}
